/*
 * Powered By cuichen
 * Since 2014 - 2018
 */package com.seeyoui.kensite.bussiness.orderlang.deliveryProduct.service;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seeyoui.kensite.common.base.service.BaseService;

import java.util.*;

import com.seeyoui.kensite.common.base.domain.EasyUIDataGrid;
import com.seeyoui.kensite.common.base.service.BaseService;
import com.seeyoui.kensite.common.exception.CRUDException;
import com.seeyoui.kensite.common.util.*;
import com.seeyoui.kensite.common.constants.StringConstant;
import com.seeyoui.kensite.bussiness.orderlang.deliveryProduct.domain.DeliveryProduct;
import com.seeyoui.kensite.bussiness.orderlang.deliveryProduct.persistence.DeliveryProductMapper;

/**
 * DeliveryProduct
 * @author cuichen
 * @version 2.0
 * @since 1.0
 * @date 2018-03-01
 */

@Service
public class DeliveryProductService extends BaseService {
	
	@Autowired
	private DeliveryProductMapper deliveryProductMapper;

	/**
	 * 根据ID查询单条数据
	 * @param id
	 * @return
	 * @throws CRUDException
	 */
	public DeliveryProduct findOne(String id) throws CRUDException{
		return deliveryProductMapper.findOne(id);
	}
	
	/**
	 * 查询数据集合
	 * @param deliveryProduct
	 * @return
	 * @throws CRUDException
	 */
	public List<DeliveryProduct> findList(DeliveryProduct deliveryProduct) throws CRUDException {
		return deliveryProductMapper.findList(deliveryProduct);
	}
	
	/**
	 * 查询所有数据集合
	 * @param deliveryProduct
	 * @return
	 * @throws CRUDException
	 */
	public List<DeliveryProduct> findAll(DeliveryProduct deliveryProduct) throws CRUDException {
		return deliveryProductMapper.findAll(deliveryProduct);
	}
	
	/**
	 * 查询数据总数
	 * @param deliveryProduct
	 * @return
	 * @throws CRUDException
	 */
	public int findTotal(DeliveryProduct deliveryProduct) throws CRUDException {
		return deliveryProductMapper.findTotal(deliveryProduct);
	}
	
	/**
	 * 查询数据总数排除当前数据
	 * @param deliveryProduct
	 * @return
	 * @throws CRUDException
	 */
	public int findExTotal(DeliveryProduct deliveryProduct) throws CRUDException {
		return deliveryProductMapper.findExTotal(deliveryProduct);
	}
	
	/**
	 * 数据新增
	 * @param deliveryProduct
	 * @throws CRUDException
	 */
	public void save(DeliveryProduct deliveryProduct) throws CRUDException{
		deliveryProduct.preInsert();
		deliveryProductMapper.save(deliveryProduct);
	}
	
	/**
	 * 数据修改
	 * @param deliveryProduct
	 * @throws CRUDException
	 */
	public void update(DeliveryProduct deliveryProduct) throws CRUDException{
		deliveryProduct.preUpdate();
		deliveryProductMapper.update(deliveryProduct);			
	}
	
	/**
	 * 数据删除
	 * @param listId
	 * @throws CRUDException
	 */
	public void delete(List<String> listId) throws CRUDException {
		deliveryProductMapper.delete(listId);
	}
	
	/**
	 * 数据假删除
	 * @param deliveryProduct
	 * @throws CRUDException
	 */
	public void remove(DeliveryProduct deliveryProduct) throws CRUDException{
		deliveryProduct.preUpdate();
		deliveryProductMapper.remove(deliveryProduct);			
	}
	
}